<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script> 
</head>
<style>
*{
    margin: 0;
    padding: 0;
}
ul li{
    list-style: none;
}
a{
    text-decoration: none;
}
.a{
    width: 500px;
    height: 50px;
    background: #f5f5f5;
}

.a ul li{
float: left;
line-height: 50px;
padding-left: 20px;
padding-right: 15px;
}
.a ul li:hover{
    background: #d8baea;
    color: #fff;
}
.clear{
    clear: both;
} 
#b{
    width: 100px;
    height: 100px;
    background: #ccc;
    display: none;
    position: relative;
}
#b li{
float: none;
font-size: 13px;
}
#d{
    width: 100px;
    height: 100px;
    background: #ccc;
position: absolute;
left: 100px;
top: 60px;
display: none;
}
#d li{
float: none;
font-size: 13px;
}

</style>
<body>
    <div class="a">
        <ul>
            <li id="c">首页</li>
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
            <div class="clear"></div>
            <ul id="b">
                <li>首页</li>
                <li>首页</li>
                <ul id="d">
                    <li>首页</li>
                    <li>首页</li>
                </ul>
            </ul>
        </ul>
    </div>
    <script>
        $(function(){
            $("#c").mouseover(function(){
              $("#b").css({display:'block'})
            })
            $("#c").click(function(){
                $("#b").css({display:'none'})
            })
            $("#b").mouseover(function(){
                $("#d").css({display:"block"})
            })
            $("#b").mouseout(function(){
                $("#d").css({display:'none'})
            })
        })
    </script>
</body>
</html>